﻿<?php 
	if(isset($_GET['bt']) and $_GET['bt']!=""){
		$mabantin=$_GET['bt'];
	}
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
	<div class="blockbody2">
    <?php 
	$mysql_str=mysql_query("Select * From tintuc Where MaBanTin=".$mabantin);	
	$row=mysql_fetch_assoc($mysql_str);
	if($row>0){
?>
    <div class="newsacs">Ngày đưa tin: <?php echo dinhdangNgay($row['NgayDang']);?></div>
   
        <div class="atclear"></div>
 
    <div class="newstitle"><h1><?php echo $row['Ten'];?></h1></div>
    <div class="newsintro"><p><?php echo $row['Tieude'];?></p></div>
        <div class="newscontent">
    <?php echo $row['Noidung'];?>
    <p style="text-align: right;" class="Normal">Theo <em><strong><?php echo $row['Tacgia'];?></strong></em></p>
<p><strong></strong></p></div>
        
        <div class="newsrelatedtitle">Các tin liên quan</div>
    <div class="newsrelated">
    	<ul>
    	<?php $mysql_str2=mysql_query("Select * From tintuc Where Ten Like '%".$row['Chude']."%' And Tintuc_id <> ".$mabantin);
			if(mysql_num_rows($mysql_str2)>0){
				while($row2=mysql_fetch_array($mysql_str2)){
		?>
    	
                	<li><a title="<?php echo $row2['Ten'];?>" href="bantin.php?bt=<?php echo $row2['Tintuc_id'];?>"><?php echo $row2['Ten'];?></a></li>
    	  <?php
                }
           }else{
				echo "<li>Hiện chưa có thông tin này.</li>";
			}?>
        </ul>
    </div>
        
  <div class="tab ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
        <div id="tittle_differ">Các tin khác</div>
        
        <div class="newsotherslist ui-tabs-panel ui-widget-content ui-corner-bottom" id="tabs_1">
	    	<ul>
            <?php $mysql_str2=mysql_query("Select * From tintuc Where  TenBanTin Not Like '%".$row['ChuDe']."%'");
			if(mysql_num_rows($mysql_str2)>0){
				while($row2=mysql_fetch_array($mysql_str2)){
		?>
    	
                	<li><a title="<?php echo $row2['TenBanTin'];?>" href="/banhang/tintuc/chitiet/bantin.php?bt=<?php echo $row2['MaBanTin'];?>"><?php echo $row2['TenBanTin'];?></a> - <span>[<?php echo dinhdangNgay($row2['NgayDang']);?>]</span></li>
    	  <?php
                }
           }else{
				echo "<li>Hiện chưa có thông tin này.</li>";
			}?>
            </ul>
       </div>
    </div>
   <?php }else{?>
		<div><?php echo die("Lỗi:".mysql_error());?></div>
<?php	}
?>
</div> 		
</body>